  <!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content=" initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <script src="../public/lobster/js/public.js"></script>
    <link rel="stylesheet" href="../public/lobster/css/public.css" />
    <link rel="stylesheet" href="../public/lobster/css/regsiter.css" />
    <link rel="stylesheet" type="text/css" href="../public/lobster/icon/iconfont.css">
    <link rel="stylesheet" href="../public/lobster/css/href.css?20170421">
    <script src="../public/lobster/js/lick.js"></script>
    <script src="../public/lobster/js/click.js"></script>
    <title>修改密码</title>
    <style>
        body{
            background: #eee;
        }
        #start_reg_btn .st_reg_btn{
            background: #8a4a2f;
        }
        #start_reg_inp .st_fd_inp span {
            background: #8a4a2f;
        }
    </style>
</head>
<body>

<div id="start_reg_inp">
    <div class="st_fd_inp">
        <span class="iconfont icon-shouji"></span>
        <input type="text" class="st_reg_code" placeholder="账号" name="loginName" id="loginName"  readonly="readonly"  value="13268132797"  >
        <h4></h4>
    </div>
    <div class="st_fd_inp">
        <span class="iconfont icon-mima2"></span>
        <input type="password" class="st_reg_ma" placeholder="请设置新密码" name="password" id="password">
        <h4></h4>
    </div>
    <div class="st_fd_inp">
        <span class="iconfont icon-gou2"></span>
        <input type="password" class="st_reg_mato" placeholder="请确认新密码" name="repeat_password" id="repeat_password">
        <h4></h4>
    </div>
    <p>*密码为6位数字组成</p>
</div>
<!--主体-确认按钮-->
<div id="start_reg_btn">
    <input type="button" class="st_reg_btn"  value="确 认" onclick="findBack()">
</div>

       <!--底部导航栏-->
 		<nav class="nav">
			<ul id="list">
				<li>
					<a href="index.html">
						<img src="../public/lobster/images/navbar01.png" alt="">
					</a>
				</li>
				<li>
					<a href="lotteryInfo.html">
						<img src="../public/lobster/images/navbar02.png" alt="">
					</a>
				</li>
				<li>
					<a href="center.html">
						<img src="../public/lobster/images/onnavbar03.png" alt="">
					</a>
				</li>
			</ul>
		</nav>
       
</body>
<script src="../public/lobster/js/jq-2.1.0.js"></script>
<script>
    $(function(){
        $("input").focus(function(){
            $("h4").html("");
        });
    })
    //提交验证
    /* function success(){
        if(frmtel("#st_reg_tel")&&noempty('.st_reg_code')&&frmpwd('.st_reg_ma')&&againpwd(".st_reg_mato",'.st_reg_ma')){
            window.location.href="index.html";
        }
    } */
    var hasSendCode = 0;  //0表示没有发送验证码 1表示发送了
    var phone = /^0?1[3|4|7|5|8][0-9]\d{8}$/;
    var reg = /^[0-9a-zA-Z]{6,99}$/;
    function findBack()
    {
    	 var password=$("#password").val();
    	 var repassword=$("#repeat_password").val();
    	 
    	 if(password.length<6){
    		 xxone.popup("提示","密码不能少于6位","确认");
    		 return ;
    	 }
    	 if(password==""||password==null){
    		 //alert("密码不能为空!")
    		 xxone.popup("提示","密码不能为空!","确认");
    		 return ;
    	 }else{
    		 if(repassword==null||repassword==""){
    			 //alert("重复密码不能为空!");
    			 xxone.popup("提示","重复密码不能为空!","确认");
    			 return ;
    		 }else{
    			 if(password!=repassword){
    				 //alert("两次输入的密码不一致");
    				 xxone.popup("提示","两次输入的密码不一致","确认");
    			 }else{
    				 //alert(password);
    				 //alert("re"+repassword)
    				 $.ajax({
    					 type:"POST",
    					 url:"/user/changePwd?v="+Math.random(),
    					 data:{"password":password,"repassword":repassword},
    					 dataType:"json",
    					 success:function(data){
    						 if(data.success){
    							 //alert("密码修改成功!");
    							 xxone.popup("提示","密码修改成功!","确认");
    							 //window.location.reload();
    							 $('#xxone-popup-done').bind('click',function(){
  		        					window.location.reload();
  			    				  });
    						 }else{
    							 //alert("密码修改失败,请稍后再试");
    							 xxone.popup("提示","密码修改失败,请稍后再试","确认");
    							 $('#xxone-popup-done').bind('click',function(){
  		        					window.location.reload();
  			    				  });
    						 }
    					 }
    				 })
    			 }
    			 
    		 }
    		 
    	 }
    }

    $(document).on('focus','input',function(e){
    	$("#phome").html("");	
    	$("#token").html("");
    	$("#pwd").html("");
    	$("#msg").html("");
    });
</script>
</html>
